//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Resource Application Block
//===============================================================================

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design;
using EntLibContrib.Resource.Configuration.Design;

#if !NUNIT
using Microsoft.VisualStudio.TestTools.UnitTesting;
#else
using NUnit.Framework;
using TestClass = NUnit.Framework.TestFixtureAttribute;
using TestInitialize = NUnit.Framework.SetUpAttribute;
using TestCleanup = NUnit.Framework.TearDownAttribute;
using TestMethod = NUnit.Framework.TestAttribute;
#endif

namespace EntLibContrib.Resource.Configuration.Design.Tests
{
	[TestClass]
	public class AddNodeCommandsFixture : ConfigurationDesignHost
	{
		[TestMethod]
		public void EnsureExcutingAddResourceManagerSettingsSetsDefaults ()
		{
			AddResourceManagerSettingsNodeCommand cmd = new AddResourceManagerSettingsNodeCommand(ServiceProvider);
			cmd.Execute(ApplicationNode);

			ResourceManagerSettingsNode node = (ResourceManagerSettingsNode)Hierarchy.FindNodeByType(typeof(ResourceManagerSettingsNode));

			Assert.AreEqual(1, node.Nodes.Count);
		}
	}
}